#ifndef __DEFINE_H__
#define __DEFINE_H__

#include "stdint.h"
#include "efr32fg14p231f128gm32.h"





#define NORMAL_BEACON_LENGTH                0X05 + 0x02      /*正常接收beacon长度*/
#define NORMAL_ACTION_LENGTH                0X0e + 0x02      /*正常接收action长度*/

#define OTA_BEACON_LENGTH                   0X0f + 0x02         /*OTA正常接收beacon长度*/
#define OTA_ACTION_LENGTH                   0X13 + 0x02         /*OTA正常接收action长度*/





#define BeaconSync      0x01 //B2T
#define AskActionSync   0x02 //T2B


/*
数据帧长度 B2T
*/
#define Length_BeaconSync          0x06
#define Length_ReplyTagActionSync  0x0F







/*
状态表
*/

typedef enum
{
  Success=0x00,
  ParaSetFail=0x01,
  ParaOutRang=0x02,
  ParaNotExist=0x03
}parState;


/*
数据帧
*/

typedef struct DataDef{
    unsigned char LoPartNo[4];
}DataFrame;



#define LoParaGet           0x88 //定位器参数获取 B2L
#define LoParaGetReturn     0x08 //定位器参数获取返回 L2B
#define LoParaSet           0x89 //定位器参数设置 B2L
#define LoParaSetReturn     0x09 //定位器参数设置返回 L2B


/*
数据帧长度 L2B
*/
#define Length_LoParaGetReturn     0x0B
#define Length_LoParaSetReturn     0x0B
#define LENGTH_RESULT_T2B         (0x0b)

#define Length_LPGReturn_IR_All_Parameter     (Length_LoParaGetReturn+45)



/*
state 定义表
*/
#define  ParaSetSuccess      0x00
#define  ParaGetSuccess      0x00
#define  ParaSetFail         0x01
#define  ParaOutRang         0x02
#define  ParaNotExist        0x03





/*iBeacon 操作********************************************************************************************/
#define   Ready     0
#define   Receiving 1
#define   Complete 2
#define   Data_Receiving 3
#define   Data_Complete  4

#define   ibeacon_set_success 0x01
#define   ibeacon_set_fail    0x00

#endif
